/**
 * 
 */
package com.xb.demo2.template.method;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import javax.management.Query;

/**
 * 模板方法定义处理流程，留出接口给子类自定义具体实现.
 * @author kexue
 *
 */
public class JdbcTemplate {

	 public static void query(String sql,CallbackProcess process ){
		 //1.连接数据库
		 //connnection.getConnection();
		 
		 //2 ps=con.preparedStatement(sql)
		 
		 //3.ps.set值
		 
		 //4.rs= ps.executeQuery(sql)
		 
		 /**
		  * 5自定义处理回调
		  */
		 ResultSet rs=null;
		 try {
			process.process( rs);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		 //6.rs.close
		 
		 //7.finally con.close
	 }
	
}
